﻿if exists (select * from sysobjects where id = object_id(N'pBUGLOGTaskAdd') and sysstat & 0xf = 4) drop procedure pBUGLOGTaskAdd 
GO

-- Creates a new record in the [dbo].[Task] table.
CREATE PROCEDURE pBUGLOGTaskAdd
    @p_TaskName varchar(50),
    @p_TaskDscription nvarchar(450),
    @p_StartedDate smalldatetime,
    @p_ExpectedEndDate smalldatetime,
    @p_Status varchar(50),
    @p_UserID int,
    @p_TaskID_out int output
AS
BEGIN
    INSERT
    INTO [dbo].[Task]
        (
            [TaskName],
            [TaskDscription],
            [StartedDate],
            [ExpectedEndDate],
            [Status],
            [UserID]
        )
    VALUES
        (
             @p_TaskName,
             @p_TaskDscription,
             @p_StartedDate,
             @p_ExpectedEndDate,
             @p_Status,
             @p_UserID
        )

    SET @p_TaskID_out = SCOPE_IDENTITY()

END

